//
//  UIColor+Shop.swift
//  shop
//
//  Created by 刘伟 on 2017/2/25.
//
//

import UIKit

enum ColorType {
    case normal
    case highlighted
    case error
}

enum BootstrapColorType {
    case normal
    case primary
    case success
    case info
    case warning
    case danger
}

extension UIColor {
    
    open class var la_app: UIColor {
        return UIColor(red:0.31666803359985352, green:0.27645963430404663, blue:0.5533900260925293, alpha:1.00)
    }
    
    open class var la_gray: UIColor {
        return UIColor(red:0.61, green:0.62, blue:0.62, alpha:1.00)
    }
    
    open class var la_grayer: UIColor {
        return UIColor(red:0.75, green:0.75, blue:0.75, alpha:1.00)
    }
    
    open class var la_bg: UIColor {
        return UIColor(red: 0.94, green: 0.94, blue: 0.96, alpha: 1)
    }
    
    // navigationBar 栏颜色
    open class var naviBarTint: UIColor {
        return UIColor.la_app
    }
    
    // navigationBar 字体颜色
    open class var naviTint: UIColor {
        return UIColor(red:1.00, green:1.00, blue:1.00, alpha:1.00)
    }
    
    // tabBar 栏颜色
    open class var tabBarTint: UIColor {
        return UIColor.white
    }
    
    // tabBar 控件颜色
    open class var tabTint: UIColor {
        return UIColor(red:0.00, green:0.41, blue:0.72, alpha:1.00)
    }
    // tabBar 中 文本颜色
    class func tabBarText(_ type: ColorType) -> UIColor {
        var color:UIColor
        switch type {
        case .normal:
            color = UIColor(red:0.60, green:0.60, blue:0.60, alpha:1.00)
        case .highlighted:
            color = UIColor.naviBarTint
        default:
            color = UIColor(red:0.60, green:0.60, blue:0.60, alpha:1.00)
        }
        return color
    }
    
    // 常用背景色 灰色
    
    open class var bg: UIColor {
        return UIColor(red:0.93, green:0.93, blue:0.93, alpha:1.00)
    }
    
    open class var line: UIColor {
        return UIColor(red:0.89, green:0.89, blue:0.89, alpha:1.00)
    }
    
    
    // UITextField 输入框的边框颜色
    class func textFeild(_ type: ColorType) -> UIColor {
        var color: UIColor
        switch type {
        case .normal:
            color = UIColor(red:0.80, green:0.80, blue:0.80, alpha:1.00)
        case .highlighted:
            color = UIColor(red:0.28, green:0.57, blue:1.00, alpha:1.00)
        case .error:
            color = UIColor(red:0.88, green:0.37, blue:0.20, alpha:1.00)
        }
        return color
    }
    
    // Bootstrap 颜色总结
    open class var normal: UIColor {
        return UIColor(red:1.00, green:1.00, blue:1.00, alpha:1.00)
    }
    
    // Bootstrap 颜色库
    open class var primary: UIColor {
        return UIColor(red:0.20, green:0.48, blue:0.72, alpha:1.00)
    }
    
    open class var success: UIColor {
        return UIColor(red:0.33, green:0.67, blue:0.33, alpha:1.00)
    }
    
    open class var info: UIColor {
        return UIColor(red:0.35, green:0.75, blue:0.86, alpha:1.00)
    }
    
    open class var warning: UIColor {
        return UIColor(red:0.93, green:0.67, blue:0.30, alpha:1.00)
    }
    
    open class var danger: UIColor {
        return UIColor(red:0.85, green:0.33, blue:0.31, alpha:1.00)
    }
    
    open class var normalHighlighted: UIColor {
        return UIColor(red:0.00, green:0.41, blue:0.72, alpha:1.00)
    }
    
    open class var primaryHighlighted: UIColor {
        return UIColor(red:0.15, green:0.37, blue:0.55, alpha:1.00)
    }
    
    open class var successHighlighted: UIColor {
        return  UIColor(red:0.27, green:0.61, blue:0.27, alpha:1.00)
    }
    
    open class var infoHighlighted: UIColor {
        return UIColor(red:0.19, green:0.69, blue:0.83, alpha:1.00)
    }
    open class var warningHighlighted: UIColor {
        return UIColor(red:0.93, green:0.59, blue:0.12, alpha:1.00)
    }
    open class var dangerHighlighted: UIColor {
        return UIColor(red:0.79, green:0.19, blue:0.17, alpha:1.00)
    }
    
    
}
